package com.qf.demo1.messages;

import org.springframework.integration.annotation.GatewayHeader;
import org.springframework.integration.annotation.MessagingGateway;
import org.springframework.integration.mqtt.support.MqttHeaders;
import org.springframework.messaging.handler.annotation.Header;
import org.springframework.messaging.handler.annotation.Headers;

@MessagingGateway(defaultRequestChannel = "outChannel")
public interface CmdMsgSend {

    /*
        默认qos等级发送到默认主题
     */
    void send(String data);

    /*
        默认qos等级发送到指定主题
     */
    void send(@Header(MqttHeaders.TOPIC) String topic, String data);
    /*
        指定qos等级发送到默认主题
     */
    void send(@Header(MqttHeaders.QOS) Integer qos, String data);
    /*
        指定qos等级发送到指定主题
     */
    void send(@Header(MqttHeaders.TOPIC) String topic,@Header(MqttHeaders.QOS) Integer qos, String data);
}
